package org.mca.mcaweb.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;

import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;

import org.mca.mcaweb.dao.UsuaDAO;
import org.mca.mcaweb.entity.Usua;
import org.mca.mcaweb.util.ResourceBundleUtil;

@Named
@ViewScoped
public class UsuaBean implements Serializable {

	private static final long serialVersionUID = 7585122039927376795L;

	private ResourceBundle bundle = ResourceBundleUtil.getResourceBunde();
	
	private List<Usua> listUsua = new ArrayList<Usua>(0);
	
	private Usua usua = new Usua();
	
	@Inject
	private UsuaDAO usuaDAO;
	
	public void init(){
		this.usua = new Usua();
		this.listUsua = usuaDAO.getDAO().listAll();
	}
	
	public void clear() {
		this.usua = new Usua();
	}
	
	public List<Usua> getListUsua() {
		return listUsua;
	}

	public Usua getUsua() {
		return usua;
	}

	public void setUsua(Usua usua) {
		this.usua = usua;
	}
}